from tkinter import *

root = Tk()
root.title = "IT Марафон"
root.geometry = "500x500"

x = int(input("Введите начальную координату по оси X: "))
y = int(input("Введите начальную координату по оси Y: "))
n = int(input("Введите коэффициент увеличения: "))

canvas=Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)
if n>=0 and 0*n+x>=0 and 0*n+y>=0 and 30*n+x<=500 and 20*n+y<=500:
    x1,y1=0*n+x,0*n+y
    x2,y2=10*n+x,0*n+y
    x3,y3=10*n+x,10*n+y
    x4,y4=20*n+x,10*n+y
    x5,y5=20*n+x,0*n+y
    x6,y6=30*n+x,0*n+y
    x7,y7=30*n+x,20*n+y
    x8,y8=0*n+x,20*n+y
    canvas.create_polygon(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)
    root.mainloop()
elif n<0 and 0*abs(n)+x>=0 and 0*abs(n)+y>=0 and 30*abs(n)+x<=500 and 20*abs(n)+y<=500:
    n=-n
    x1,y1=0*n+x,0*n+y
    x2,y2=30*n+x,0*n+y
    x3,y3=30*n+x,20*n+y
    x4,y4=20*n+x,20*n+y
    x5,y5=20*n+x,10*n+y
    x6,y6=10*n+x,10*n+y
    x7,y7=10*n+x,20*n+y
    x8,y8=0*n+x,20*n+y
    canvas.create_polygon(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)
else:
    print("Размер фигуры превышает максимальный размер поля")
